package com.hong.web;

import com.hong.service.UserService;
import com.mysql.fabric.HashShardMapping;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@WebServlet("/UserServlet")
public class UserServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        UserService userService=new UserService();
        String user = userService.getUser();
        response.setContentType("text/html;charset=utf-8");
        response.getWriter().println(user);
    }


    public static void main(String[] args) {
        Map<String, String> map=new HashMap<>();

    }
}
